The Database and Database Tables Objects

All reports must connect to a data source to obtain data. The most commonly used data source is a relational database. The Report Designer Object Model, therefore, has provided objects, properties, and methods specific to working with databases.

The Database object is available directly from the Report object and represents the data source used by the report. This data source can be changed using the Database object's SetDataSource method. In addition, the Database object provides the Tables property, a read-only property that gets the DatabaseTables collection of DatabaseTable objects. You have access to log on information (for password protected systems), database driver names, and database locations through a DatabaseTable object. Use code similar to the following in order to work with the Database and DatabaseTable objects:

Dim Report As New CrystalReport1
Dim tableName As String Dim dbTable As CRAXDRT.DatabaseTable Report.Database.Verify() ' Verifies a valid connection to the database For Each dbTable In Report.Database.Tables tableName = dbTable.Name Next


Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com